<template>
<el-menu
    :default-active="route.path"
    :router="true"
    mode="horizontal"
  >
    <el-menu-item
      v-for="item in menus"
      :key="item.path"
      :index="item.path"
    >
      {{item.name}}
    </el-menu-item>
  </el-menu>
  <router-view></router-view>
</template>
<script setup>
import { useRoute } from 'vue-router'
const route = useRoute()

const menus = [
  {
    path: '/admin/students',
    name: '学生管理'
  },
  {
    path: '/admin/classes',
    name: '班级管理'
  },
  {
    path: '/admin/homeworks',
    name: '作业管理'
  }
]
</script>
